﻿using System;
using System.Linq.Expressions;
using CloudShot.Editor.CanvasFigures;

//TODO remove this. why do we need that?!
namespace CloudShot.Utils.Tweens
{
  class FloatAnimationAdapter<T> : AnimationAdapter where T : IBoundingBoxFigure
  {
    public FloatAnimationAdapter(T target, Expression<Func<T, float>> expression, float to)
      : base(target, expression.GetPropertyInfo(), 0, to)
    {
      Begin = (float) PropertyInfo.GetValue(target);
    }

    public override void SetValue(float value)
    {
      PropertyInfo.SetValue(Target, value, null);
    }
  }
}
